@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using SanJ.FreeCare.Permissions
@using SanJ.FreeCare.Web.Pages.Medications
@using SanJ.FreeCare.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using SanJ.FreeCare.Localization
@inject IHtmlLocalizer<FreeCareResource> L
@inject IAuthorizationService Authorization
@model IndexModel
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["Medications"].Value;
    PageLayout.Content.MenuItemName = FreeCareMenus.Medications;
}

@section styles
{
@*//<suite-custom-code-block-1>*@
@*//</suite-custom-code-block-1>*@
}

@section scripts
{
    <abp-script src="/Pages/Medications/index.js" />
@*//<suite-custom-code-block-2>*@
@*//</suite-custom-code-block-2>*@
}

@section content_toolbar {
    <abp-button id="ExportToExcelButton" text="@L["ExportToExcel"].Value" icon="download" size="Small" button-type="Primary" />
    @if (await Authorization.IsGrantedAsync(FreeCarePermissions.Medications.Create))
    {
        <abp-button id="NewMedicationButton" text="@L["NewMedication"].Value" icon="plus" size="Small" button-type="Primary" />
    }
@*//<suite-custom-code-block-3>*@
@*//</suite-custom-code-block-3>*@
}

@*//<suite-custom-code-block-4>*@
@*//</suite-custom-code-block-4>*@

<abp-card>
    <abp-card-body>
		<abp-row class="mb-3">
            <abp-column size-md="_12">
                <form id="SearchForm" autocomplete="off">
                    <div class="input-group">
                        <input class="form-control page-search-filter-text" id="FilterText" placeholder="@L["Search"]"/>
                        <abp-button button-type="Primary" type="submit" icon="search"/>
                    </div>
                </form>
            </abp-column>
            <abp-column size-md="_12" class="mt-3">
                <a href="javascript:;" id="AdvancedFilterSectionToggler" class="text-decoration-none">@L["SeeAdvancedFilters"]</a>
            </abp-column>
        </abp-row>

        <abp-row id="AdvancedFilterSection" style="display: none;">
            <abp-column size="_3">
                <abp-input asp-for="CodeFilter" label="@L["Code"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="StatusCodeFilter" label="@L["StatusCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="KeyWordFilter" label="@L["KeyWord"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ProductNameFilter" label="@L["ProductName"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ProductNamePYFilter" label="@L["ProductNamePY"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ProductNameWBFilter" label="@L["ProductNameWB"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ProductNameENFilter" label="@L["ProductNameEN"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AliasFilter" label="@L["Alias"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AliasPYFilter" label="@L["AliasPY"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AliasWBFilter" label="@L["AliasWB"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AliasENFilter" label="@L["AliasEN"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ScientificNameFilter" label="@L["ScientificName"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ScientificNamePYFilter" label="@L["ScientificNamePY"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ScientificNameWBFilter" label="@L["ScientificNameWB"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ScientificNameENFilter" label="@L["ScientificNameEN"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiLevelCodeFilter" label="@L["AntiLevelCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiClassCode1Filter" label="@L["AntiClassCode1"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiClassCode2Filter" label="@L["AntiClassCode2"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AnitDDDUnitCodeFilter" label="@L["AnitDDDUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AnitDDDValueFilterMin" label="@L["MinAnitDDDValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AnitDDDValueFilterMax" label="@L["MaxAnitDDDValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiOnceMinValueFilterMin" label="@L["MinAntiOnceMinValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiOnceMinValueFilterMax" label="@L["MaxAntiOnceMinValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiOnceMaxValueFilterMin" label="@L["MinAntiOnceMaxValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiOnceMaxValueFilterMax" label="@L["MaxAntiOnceMaxValue"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiOnceUnitCodeFilter" label="@L["AntiOnceUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiFrequencyMinFilterMin" label="@L["MinAntiFrequencyMin"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiFrequencyMinFilterMax" label="@L["MaxAntiFrequencyMin"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiFrequencyMaxFilterMin" label="@L["MinAntiFrequencyMax"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="AntiFrequencyMaxFilterMax" label="@L["MaxAntiFrequencyMax"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="GBCodeFilter" label="@L["GBCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="TypeCodeFilter" label="@L["TypeCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ClassCodeFilter" label="@L["ClassCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="FeeTypeCodeFilter" label="@L["FeeTypeCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SpecialTypeCodeFilter" label="@L["SpecialTypeCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="LevelCodeFilter" label="@L["LevelCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DoseFormCodeFilter" label="@L["DoseFormCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SpecificationFilter" label="@L["Specification"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="BaseUnitCodeFilter" label="@L["BaseUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ClinicSaleUnitCodeFilter" label="@L["ClinicSaleUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ClinicSaleVolumeFilterMin" label="@L["MinClinicSaleVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="ClinicSaleVolumeFilterMax" label="@L["MaxClinicSaleVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="InpatientSaleUnitCodeFilter" label="@L["InpatientSaleUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="InpatientSaleVolumeFilter" label="@L["InpatientSaleVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="TransportUnitCodeFilter" label="@L["TransportUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="TransportVolumeFilter" label="@L["TransportVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefaultDoseUnitCodeFilter" label="@L["DefaultDoseUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefultDoseVolumeFilterMin" label="@L["MinDefultDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefultDoseVolumeFilterMax" label="@L["MaxDefultDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SecondDoseUnitCodeFilter" label="@L["SecondDoseUnitCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SecondDoseVolumeFilterMin" label="@L["MinSecondDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SecondDoseVolumeFilterMax" label="@L["MaxSecondDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="RetailPriceFilterMin" label="@L["MinRetailPrice"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="RetailPriceFilterMax" label="@L["MaxRetailPrice"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefaultUsageCodeFilter" label="@L["DefaultUsageCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefaultFrequencyCodeFilter" label="@L["DefaultFrequencyCode"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefaultDoseVolumeFilterMin" label="@L["MinDefaultDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="DefaultDoseVolumeFilterMax" label="@L["MaxDefaultDoseVolume"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SkinTestFlagFilter" label="@L["SkinTestFlag"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SkinTestNeedFlagFilter" label="@L["SkinTestNeedFlag"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SkinTestTypeFlagFilter" label="@L["SkinTestTypeFlag"].Value" />
            </abp-column>
            <abp-column size="_3">
                <abp-input asp-for="SkinTestCodeFilter" label="@L["SkinTestCode"].Value" />
            </abp-column>
@*//<suite-custom-code-block-5>*@
@*//</suite-custom-code-block-5>*@
        </abp-row>
        
        <div id="bulk-delete-context-menu" class="d-none">
            <div class="d-flex justify-content-between align-items-center mb-2">
                <p class="lead mb-0 d-none" id="items-selected-info-message"></p>
                            
                <div>
                    <button class="btn btn-outline-secondary d-none mx-1" id="select-all-items-btn"></button>
                                
                    <button class="btn btn-outline-secondary d-none mx-1" id="clear-selection-btn">
                        @L["ClearSelection"]
                    </button>
                                
                    <button class="btn btn-danger mx-1" id="delete-selected-items">
                        <i class="fa fa-trash"></i> @L["Delete"]
                    </button>
                </div>
                
            </div>
            
            <hr class="my-1 mx-0"/>
        </div>

        <abp-table striped-rows="true" id="MedicationsTable">
            <thead>
				<tr>
				    <th id="BulkDeleteCheckboxTheader"><input type="checkbox" id="select_all" class="form-check-input" /></th>
				    
					<th>@L["Actions"]</th>
					<th>@L["Code"]</th>
					<th>@L["StatusCode"]</th>
					<th>@L["KeyWord"]</th>
					<th>@L["ProductName"]</th>
					<th>@L["ProductNamePY"]</th>
					<th>@L["ProductNameWB"]</th>
					<th>@L["ProductNameEN"]</th>
					<th>@L["Alias"]</th>
					<th>@L["AliasPY"]</th>
					<th>@L["AliasWB"]</th>
					<th>@L["AliasEN"]</th>
					<th>@L["ScientificName"]</th>
					<th>@L["ScientificNamePY"]</th>
					<th>@L["ScientificNameWB"]</th>
					<th>@L["ScientificNameEN"]</th>
					<th>@L["AntiLevelCode"]</th>
					<th>@L["AntiClassCode1"]</th>
					<th>@L["AntiClassCode2"]</th>
					<th>@L["AnitDDDUnitCode"]</th>
					<th>@L["AnitDDDValue"]</th>
					<th>@L["AntiOnceMinValue"]</th>
					<th>@L["AntiOnceMaxValue"]</th>
					<th>@L["AntiOnceUnitCode"]</th>
					<th>@L["AntiFrequencyMin"]</th>
					<th>@L["AntiFrequencyMax"]</th>
					<th>@L["GBCode"]</th>
					<th>@L["TypeCode"]</th>
					<th>@L["ClassCode"]</th>
					<th>@L["FeeTypeCode"]</th>
					<th>@L["SpecialTypeCode"]</th>
					<th>@L["LevelCode"]</th>
					<th>@L["DoseFormCode"]</th>
					<th>@L["Specification"]</th>
					<th>@L["BaseUnitCode"]</th>
					<th>@L["ClinicSaleUnitCode"]</th>
					<th>@L["ClinicSaleVolume"]</th>
					<th>@L["InpatientSaleUnitCode"]</th>
					<th>@L["InpatientSaleVolume"]</th>
					<th>@L["TransportUnitCode"]</th>
					<th>@L["TransportVolume"]</th>
					<th>@L["DefaultDoseUnitCode"]</th>
					<th>@L["DefultDoseVolume"]</th>
					<th>@L["SecondDoseUnitCode"]</th>
					<th>@L["SecondDoseVolume"]</th>
					<th>@L["RetailPrice"]</th>
					<th>@L["DefaultUsageCode"]</th>
					<th>@L["DefaultFrequencyCode"]</th>
					<th>@L["DefaultDoseVolume"]</th>
					<th>@L["SkinTestFlag"]</th>
					<th>@L["SkinTestNeedFlag"]</th>
					<th>@L["SkinTestTypeFlag"]</th>
					<th>@L["SkinTestCode"]</th>

@*//<suite-custom-code-block-6>*@
@*//</suite-custom-code-block-6>*@
				</tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>

@*//<suite-custom-code-block-7>*@
@*//</suite-custom-code-block-7>*@